import Config.RegistryConfig;
import Config.RpcConfig;
import boot.RpcApplication;
import io.grpc.LoadBalancer;
import loadBalancer.ConsistentHashBalancer;
import loadBalancer.LoadBalance;
import loadBalancer.RandomBalancer;
import loadBalancer.RoundBalancer;
import model.ServiceInfo;
import register.EtcdRegistry;
import register.Registry;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class ConsumerTest {
    public static void main(String[] avgs){
//        LoadBalance loadBalancer = new ConsistentHashBalancer();
//        // 请求参数
//        Map<String, Object> requestParams = new HashMap<>();
//        requestParams.put("methodName", "searnskjnrdfsdf");
//        // 服务列表
//        ServiceInfo serviceMetaInfo1 = new ServiceInfo();
//        serviceMetaInfo1.setServiceName("myService");
//        serviceMetaInfo1.setServiceVersion("1.0");
//        serviceMetaInfo1.setServiceHost("localhost");
//        serviceMetaInfo1.setServicePort(1234);
//        ServiceInfo serviceMetaInfo2 = new ServiceInfo();
//        serviceMetaInfo2.setServiceName("myService");
//        serviceMetaInfo2.setServiceVersion("1.0");
//        serviceMetaInfo2.setServiceHost("yupi.icu");
//        serviceMetaInfo2.setServicePort(80);
//        List<ServiceInfo> serviceMetaInfoList = Arrays.asList(serviceMetaInfo1, serviceMetaInfo2);
//        // 连续调用 3 次
//        ServiceInfo serviceMetaInfo = loadBalancer.selectServiceFromList(requestParams, serviceMetaInfoList);
//        System.out.println(serviceMetaInfo);
//
//        serviceMetaInfo = loadBalancer.selectServiceFromList(requestParams, serviceMetaInfoList);
//        System.out.println(serviceMetaInfo);
//
//        serviceMetaInfo = loadBalancer.selectServiceFromList(requestParams, serviceMetaInfoList);
//        System.out.println(serviceMetaInfo);
//        serviceMetaInfo = loadBalancer.selectServiceFromList(requestParams, serviceMetaInfoList);
//        System.out.println(serviceMetaInfo);

        String s = "hello";
        String ss = new String("hello");
        System.out.print(s == ss);

    }
}
